package Boundry;

import javax.swing.JPanel;

import Boundry.GenericTools.IPanelOperation;
import Boundry.GenericTools.InputPanel;
import Boundry.GenericTools.MultiTabbedRequestTableList;
import Boundry.GenericTools.TableListPanel;
import Controllers.GenericToolsForController.PDFfile;

import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.border.TitledBorder;
import java.awt.SystemColor;
import javax.swing.border.LineBorder;
import java.awt.Color;
import java.util.Date;

import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.JButton;
import javax.swing.ImageIcon;
import javax.swing.JRadioButton;

public class ReviewAndDecisionGUI extends InputPanel implements IPanelOperation{
	/**
	 */	
	private static final long serialVersionUID = 1L;
	private JTextField txtCreationDate;
	
	private JTextField txtInfoSystem;
	private JTextField txtInitiator;
	private JButton btnViewEVAReport;
	
	private JTextPane txtPropChange;
	private JTextPane txtExcuse;
	private JTextPane txtNotes;
	private JTextPane txtDescription;
	private JPanel step3Pane;
	private JRadioButton rdbtnApprove;
	
	private JRadioButton rdbtnDeny;
	private JRadioButton rdbtnNeedsMoreInformation;
	private JTextPane txtpnMoreinfo;
	private JLabel lblToContinueTo;
	
	
	/**
	 * Create the panel.
	 */
	public ReviewAndDecisionGUI()  {
		btnAskForMoreTime.setText("");
		btnAskForMoreTime.setLocation(640, 11);
		mainPanel.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBorder(new TitledBorder(null, "Step 2 : View Change Request Information", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel.setBounds(32, 11, 842, 260);
		mainPanel.add(panel);
		panel.setLayout(null);
		
		txtCreationDate = new JTextField();
		txtCreationDate.setBounds(118, 156, 160, 20);
		panel.add(txtCreationDate);
		txtCreationDate.setEnabled(false);
		txtCreationDate.setEditable(false);
		txtCreationDate.setColumns(10);
		txtCreationDate.setBackground(SystemColor.inactiveCaptionText);
		
		
		txtInitiator = new JTextField();
		txtInitiator.setBounds(118, 187, 160, 20);
		panel.add(txtInitiator);
		txtInitiator.setEnabled(false);
		txtInitiator.setEditable(false);
		txtInitiator.setColumns(10);
		txtInitiator.setBackground(SystemColor.inactiveCaptionText);
		
		txtInfoSystem = new JTextField();
		txtInfoSystem.setBounds(118, 215, 160, 20);
		panel.add(txtInfoSystem);
		txtInfoSystem.setEnabled(false);
		txtInfoSystem.setEditable(false);
		txtInfoSystem.setColumns(10);
		txtInfoSystem.setBackground(SystemColor.inactiveCaptionText);
		
		
		txtNotes = new JTextPane();
		txtNotes.setBounds(403, 38, 218, 59);
		panel.add(txtNotes);
		txtNotes.setEnabled(false);
		txtNotes.setEditable(false);
		txtNotes.setBackground(SystemColor.inactiveCaptionText);
		
		txtPropChange = new JTextPane();
		txtPropChange.setBounds(403, 182, 218, 53);
		panel.add(txtPropChange);
		txtPropChange.setEnabled(false);
		txtPropChange.setEditable(false);
		txtPropChange.setBackground(SystemColor.inactiveCaptionText);
		
		txtExcuse = new JTextPane();
		txtExcuse.setBounds(403, 102, 218, 74);
		panel.add(txtExcuse);
		txtExcuse.setEnabled(false);
		txtExcuse.setEditable(false);
		txtExcuse.setBackground(SystemColor.inactiveCaptionText);
		
		txtDescription = new JTextPane();
		txtDescription.setBounds(118, 38, 160, 107);
		panel.add(txtDescription);
		txtDescription.setForeground(Color.RED);
		txtDescription.setEnabled(false);
		txtDescription.setEditable(false);
		txtDescription.setBackground(SystemColor.inactiveCaptionText);
		
		JLabel lblNotes = new JLabel("Notes :");
		lblNotes.setBounds(341, 38, 120, 14);
		panel.add(lblNotes);
		
		JLabel label_5 = new JLabel("Info System:");
		label_5.setBounds(10, 218, 120, 14);
		panel.add(label_5);
		
		JLabel label_6 = new JLabel("Initiator:");
		label_6.setBounds(10, 190, 120, 14);
		panel.add(label_6);
		
		JLabel label_1 = new JLabel("Date of creation:");
		label_1.setBounds(10, 159, 120, 14);
		panel.add(label_1);
		
		JLabel label = new JLabel("Description:");
		label.setBounds(10, 38, 86, 14);
		panel.add(label);
		
		JLabel label_7 = new JLabel("Proposed Change: ");
		label_7.setBounds(288, 182, 136, 14);
		panel.add(label_7);
		
		JLabel label_3 = new JLabel("Excuse: ");
		label_3.setBounds(341, 104, 120, 14);
		panel.add(label_3);
		
		JLabel lblViewEvaluationReport = new JLabel("Open Evaluation Report");
		lblViewEvaluationReport.setBounds(691, 159, 160, 14);
		panel.add(lblViewEvaluationReport);
		
		btnViewEVAReport = new JButton("");
		btnViewEVAReport.setBounds(681, 176, 136, 59);
		panel.add(btnViewEVAReport);
		btnViewEVAReport.setIcon(new ImageIcon(ReviewAndDecisionGUI.class.getResource("/ICONS/5_content_paste.png")));
		
		lblToContinueTo = new JLabel("Press here to continue ");
		lblToContinueTo.setBounds(691, 235, 202, 14);
		panel.add(lblToContinueTo);
		
		step3Pane = new JPanel();
		step3Pane.setBorder(new TitledBorder(null, "Step 3 : Decide to Approve/Deny Request", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		step3Pane.setBounds(32, 285, 842, 83);
		mainPanel.add(step3Pane);
		step3Pane.setLayout(null);
		
		rdbtnApprove = new JRadioButton("Approve");
		rdbtnApprove.setBounds(26, 28, 109, 23);
		step3Pane.add(rdbtnApprove);
		
		rdbtnDeny = new JRadioButton("Deny");
		rdbtnDeny.setBounds(137, 28, 109, 23);
		step3Pane.add(rdbtnDeny);
		
		rdbtnNeedsMoreInformation = new JRadioButton("Needs more information");
		rdbtnNeedsMoreInformation.setBounds(248, 28, 164, 23);
		step3Pane.add(rdbtnNeedsMoreInformation);
		
		txtpnMoreinfo = new JTextPane();
		txtpnMoreinfo.setBounds(414, 22, 418, 50);
		txtpnMoreinfo.setVisible(false);
		step3Pane.add(txtpnMoreinfo);
		step3Pane.setVisible(false);
		
		this.btnAskForMoreTime.setIcon(new ImageIcon(ReviewAndDecisionGUI.class.getResource("/ICONS/10_device_access_time.png")));
		this.btnAskForMoreTime.setBounds(442, 11, 65, 32);
		this.btnAskForMoreTime.setVisible(true);
	
	}
	@Override
	public String apHelpButton() {
		
		return "Review and decide about a request";
	}
	@Override
	public String setTitle() {
		return "Review And Decision";
	}
	
	
	public JTextField getTxtCreationDate() {
		return txtCreationDate;
	}
	public JTextField getTxtInfoSystem() {
		return txtInfoSystem;
	}
	public JTextField getTxtInitiator() {
		return txtInitiator;
	}
	public JTextPane getTxtPropChange() {
		return txtPropChange;
	}
	public JTextPane getTxtExcuse() {
		return txtExcuse;
	}
	public JTextPane getTxtNotes() {
		return txtNotes;
	}
	public JTextPane getTxtDescription() {
		return txtDescription;
	}
	public void setTxtCreationDate(Date CreationDate) {
		txtCreationDate.setText(CreationDate.toString()); 
	}
	public void setTxtInfoSystem(String InfoSystem) {
		txtInfoSystem.setText(InfoSystem) ;
	}
	public void setTxtInitiator(String Initiator) {
		txtInitiator.setText(Initiator) ;
	}
	public void setTxtPropChange(String PropChange) {
		txtPropChange.setText(PropChange) ;
	}
	public void setTxtExcuse(String Excuse) {
		txtExcuse.setText(Excuse) ;
	}
	public void setTxtNotes(String Notes) {
		txtNotes.setText(Notes) ;
	}
	public void setTxtDescription(String Description) {
		txtDescription.setText(Description);
	}
	
	public JButton getBtnViewEVAReport() {
		return btnViewEVAReport;
	}
	public void setBtnViewEVAReport(JButton btnViewEVAReport) {
		this.btnViewEVAReport = btnViewEVAReport;
	}
	public JPanel getStep3Pane() {
		return step3Pane;
	}
	public void setStep3Pane(JPanel step3Pane) {
		this.step3Pane = step3Pane;
	}
	
	public JRadioButton getRdbtnApprove() {
		return rdbtnApprove;
	}
	public JRadioButton getRdbtnDeny() {
		return rdbtnDeny;
	}
	public JRadioButton getRdbtnNeedsMoreInformation() {
		return rdbtnNeedsMoreInformation;
	}
	public JTextPane getTxtpnMoreinfo() {
		return txtpnMoreinfo;
	}
	public void setRdbtnApprove(JRadioButton rdbtnApprove) {
		this.rdbtnApprove = rdbtnApprove;
	}
	public void setRdbtnDeny(JRadioButton rdbtnDeny) {
		this.rdbtnDeny = rdbtnDeny;
	}
	public void setRdbtnNeedsMoreInformation(JRadioButton rdbtnNeedsMoreInformation) {
		this.rdbtnNeedsMoreInformation = rdbtnNeedsMoreInformation;
	}
	public void setTxtpnMoreinfo(JTextPane txtpnMoreinfo) {
		this.txtpnMoreinfo = txtpnMoreinfo;
	}

	
}

